package com.tpindividual.tpej1;
import android.widget.EditText;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class ActivityInput extends Activity {
	
	private Triangulo model;
	private MiVistaInput view;
	private MiControllerInput controller;
	
    private EditText numero1;
    private EditText numero2;
    private EditText numero3;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.activity_activity_input);
        
        // Create MVC
        model = new Triangulo();
        view = new MiVistaInput(this, model);
        controller = new MiControllerInput(model, view, this);
        

        numero1 = (EditText) findViewById(R.id.editText1);
        numero2 = (EditText) findViewById(R.id.editText2);
        numero3 = (EditText) findViewById(R.id.editText3);
        
        // Bind controller to buttons
        findViewById(R.id.triangle).setOnClickListener(controller);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_input, menu);
        
        return true;
    }
    
    public EditText getErrorText(){
    	EditText error_text = (EditText) findViewById(R.id.errorText);
    	return error_text;
    }
    
    public EditText getNumero1(){
    	return numero1;
    }

    public EditText getNumero2(){
    	return numero2;
    }
    
    public EditText getNumero3(){
    	return numero3;
    }
 
    public MiVistaInput getVista(){
    	return view;
    }
    
}


